import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.UnknownHostException;


public class MyClient2 {

	public static void main(String[] args) throws IOException {


		// Send response to the client
		String response = "test1.txt";
		byte[] responseBuf = response.getBytes();
		InetAddress T = null;
		//System.out.println(T.getLocalHost().getAddress());
		InetAddress senderIP = T.getLocalHost();
		//InetAddress senderIP = ;
		int senderPort = 12345 ;
		DatagramPacket packetOut = new DatagramPacket(
		responseBuf, responseBuf.length,
		senderIP, senderPort);

		DatagramSocket datagramSocket =	new DatagramSocket(12345);

		
		datagramSocket.send(packetOut);
				
				
		// Receive UDP client request
		byte[] receiveBuf = new byte[1024];
		DatagramPacket packetIn = new
		DatagramPacket(receiveBuf, receiveBuf.length);
		datagramSocket.receive(packetIn);
		System.out.println(receiveBuf);
		
	}
}
